package com.lxb.eduservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lxb.eduservice.entity.EduCourseDescription;
import com.lxb.eduservice.entity.EduVideo;
import com.lxb.eduservice.mapper.EduCourseDescriptionMapper;
import com.lxb.eduservice.service.EduCourseDescriptionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 课程简介 服务实现类
 *
 * @author lixuebin
 * @since 2022-11-06
 */
@Service
public class EduCourseDescriptionServiceImpl extends ServiceImpl<EduCourseDescriptionMapper, EduCourseDescription> implements EduCourseDescriptionService {

    @Override
    public int add(EduCourseDescription description) {
        int insert = baseMapper.insert(description);
        return insert;
    }

    @Override
    public void removeDescriptionById(String courseId) {
        QueryWrapper<EduCourseDescription> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",courseId);
        baseMapper.delete(queryWrapper);
    }
}
